package Day09;

import java.sql.SQLOutput;
import java.util.InputMismatchException;
import java.util.Scanner;

public class Texxt3 {
    private static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        try{
            int number = getNumber();
            System.out.println(number);
        } catch(InputMismatchException e){
            e.printStackTrace();
            System.out.println(e.getClass().getName());
            System.out.println("异常信息" + e.getMessage());
            System.out.println("不要乱搞，请输入数字");
        }
        System.out.println("发生异常在之后也能执行");
    }

    public static int getNumber() throws InputMismatchException {
        System.out.println("请输入数字");
        int number = sc.nextInt();
        return number;
    }
}
